package com.hjt.zhibo.action;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

import jodd.util.URLDecoder;

import com.hjt.zhibo.model.PlatFormCatalog;
import com.jfinal.core.ActionKey;
import com.jfinal.core.Controller;


public class CommonAction  extends Controller {

	
	public void index() {
		renderJsp("/page/index_1.jsp");	
	}
	
	@ActionKey("/all")
	public void all(){
		setAttr("platform", getPara(0));
		renderJsp("/page/all_1.jsp");
	}
	
	@ActionKey("/platform")
	public void platform(){
		
		PlatFormCatalog platFormCatalog = 
				PlatFormCatalog.dao.findFirst("select * from platform_catalog t where t.prefix=? and t.platform_catalog_id=? ", getPara(0), getPara(1));
		setAttr("platform", platFormCatalog.get("platform"));
		setAttr("roomType", platFormCatalog.get("platform_cn_name"));
		
		setAttr("hasTitle", true);
		setAttr("navTitle", "涵盖" + platFormCatalog.get("platform") + "直播平台中关于英雄联盟的所有直播");
		
		renderJsp("/page/index_1.jsp");	
		//renderJsp("/page/platform_1.jsp");
	}
	
	@ActionKey("/p")
	public void p() {
		
		setAttr("roomType", URLDecoder.decode(getPara(0), "UTF-8"));
		
		setAttr("hasTitle", true);
		setAttr("navTitle", "涵盖斗鱼TV、熊猫TV、播平台中关于英雄联盟的所有直播");
		
		renderJsp("/page/index_1.jsp");	
		//renderJsp("/page/platform_1.jsp");
	}
	
	@ActionKey("/s")
	public void seach(){
		setAttr("key", getPara("key"));
		renderJsp("/page/index_1.jsp");	
	}
	
	
	
}
